fn number_to_base_string(mut num: u32, base: u32) -> String {
    assert!(base >= 2, "Base must be at least 2");
    let mut result = String::new();
    while num > 0 {
        let digit = num % base;
        result.push(std::char::from_digit(digit, base).unwrap());
        num /= base;
    }
    result.chars().rev().collect() // 反转字符串得到正确的顺序
}
pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let num_str: Vec<&str> = num_str.trim().split("(").collect();
    let num = num_str.get(0).unwrap();
    let from_base = num_str
        .get(1)
        .unwrap()
        .split(")")
        .next()
        .unwrap()
        .parse::<u32>()
        .unwrap();
    let num = u32::from_str_radix(num, from_base).unwrap();
    number_to_base_string(num, to_base)
}
